// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
// 引入路由+挂载
import router from './router/router.js'

import common from './assets/common/common.css'
// 引入mui全部组件
import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'

// 引入axios
import axios from 'axios'

Vue.prototype.$http = axios
Vue.prototype.HOST = '/api'
Vue.use(MintUI)

Vue.config.productionTip = false
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})

// 请求拦截器
axios.interceptors.request.use(
  config => {
    console.log(config.headers)
    config.headers.sign =
      'T#cS$9FJKZ9az6!0' + '-dowriteoff-' + Date.parse(new Date()) / 1000
    return config
    // console.log('test' + config.headers.sign)
  },
  error => {
    return Promise.reject(error)
  }
)
